#ifndef TileMAP_H
#define TileMAP_H 
#include "Defines.h"
#include<D3DX9.h>
#include "Tile.h"
class ENGINE_API TileMap
{
public:
	void SetTileWidht(int tilewidth){m_TileW=tilewidth;}
	void SetTileHeight(int tileheight){m_TileH = tileheight;}
	void SetWidht(int width){m_CountTileW = width;}
	void SetHeight(int height){m_CountTileH = height;}
	void SetTexture(Texture* p_texture){m_texture = p_texture;}
	void SetLayerCount(int cant){m_LayerCount= cant;}
	void SetTiledUsed(std::map<int,Tile*> f_mTilesUsed){ m_mTilesUsed=f_mTilesUsed;}
	void Draw(Renderer * m_pkRenderer);
	void setScaleTileMap(float p_fWidth, float p_fHeight);
	void AddLayer(std::string Name,std::vector<int*> layer){m_iTileMap[Name] = layer;}
	std::map<std::string,std::vector<int*>>* GetTileMap(){return &m_iTileMap;}
	int GetCountTileW(){return m_CountTileW;}
	int GetCountTileH(){return m_CountTileH;}
	int GetTileW(){return m_TileW;}
	int GetTileH(){return m_TileH;}
	Texture* GetTexture(){return m_texture;}
	void SetSpacing(int p_Spacing){m_Spacing = p_Spacing;}
	int GetSpacing(){return m_Spacing;}
	void getRowCol(int Pos, int Cols, int *Col, int* Row);
	void SetPos(int x,int y, int z){PosicionInicial.x =x;PosicionInicial.y =y;PosicionInicial.z =z;}
	TileMap();
private:
	std::map<std::string,std::vector<int*>> m_iTileMap;
	std::map<std::string,std::vector<int*>>::iterator m_iTileMapIter;
	int m_TileW;
	int m_TileH;
	int m_Spacing;
	int m_CountTileH;
	int m_CountTileW;
	int m_LayerCount;
	int m_iMapScaleW;
	int m_iMapScaleH;

	D3DXVECTOR3 PosicionInicial;
	std::map<int,Tile*> m_mTilesUsed;
	Texture* m_texture;
};
#endif